/**
 * Loader Modules
 * Date: 2015/04/07;
 */
define(['jquery'], function ($, Spinner) {
	var VamLoader;
	VamLoader = (function() {
		function VamLoader() {
			this.settings = {};
			this.loadingTemplate = '<div class="loading-section-wrap text-center">'
			  									 + '<div class="spinner"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div>'
			  									 + '<p class="loading-text"><strong>Loading...</strong></p>'
			  									 + '</div>';
		}

		VamLoader.prototype.defaults = {
		  lines: 17, // The number of lines to draw
		  length: 0, // The length of each line
		  width: 10, // The line thickness
		  radius: 32, // The radius of the inner circle
		  corners: 1, // Corner roundness (0..1)
		  rotate: 5, // The rotation offset
		  direction: 1, // 1: clockwise, -1: counterclockwise
		  color: '#292a2f', // #rgb or #rrggbb or array of colors
		  speed: 1.6, // Rounds per second
		  trail: 100, // Afterglow percentage
		  shadow: false, // Whether to render a shadow
		  hwaccel: true, // Whether to use hardware acceleration
		  className: 'spinner', // The CSS class to assign to the spinner
		  zIndex: 2e9, // The z-index (defaults to 2000000000)
		  top: '50%', // Top position relative to parent
		  left: '50%' // Left position relative to parent
		};
		VamLoader.prototype.init = function(options) {
			options = options || {};
			$.extend(this.settings, options, this.defaults);
		};
		VamLoader.prototype.loader = function($loadingWrap, options) {
			this.init(options);
			// var target = $loadingWrap.get(0), spinner;
			// spinner = new Spinner(this.settings).spin(target);
			$loadingWrap.html(this.loadingTemplate);
			return $loadingWrap;
		};
		return VamLoader;
	})();

	return VamLoader;
});
